package org.gd.hellojaxb.example.interfaces;

import javax.xml.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;

@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = "users")
public class XmlListUser {

    @XmlElement(name = "user")
    private List<XmlUser> users;

    @XmlElement(name = "str")
    @XmlList
    private List<String> str;


    public XmlListUser() {
        users = new ArrayList<XmlUser>();
        str = new ArrayList<String>();
        str.add("<str1/>");
        str.add("<str2/>");
        str.add("<str3/>");
    }

    public List<String> getStr() {
        return str;
    }

    public List<XmlUser> getUsers() {
        return users;
    }

    public boolean add(XmlUser xmlUser) {
        return users.add(xmlUser);
    }
}
